package com.jandan.ui.client;

import com.gwtext.client.core.RegionPosition;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.layout.BorderLayout;
import com.gwtext.client.widgets.layout.BorderLayoutData;
import com.gwtext.client.widgets.layout.VerticalLayout;

public class BannerPanel extends Panel {
	private ILessonOperator lessonOperate;
	private SearchPanel searchPanel;
	
	public BannerPanel(){
		createComponent();
		this.setBorder(false);
	}
	
	public BannerPanel(ILessonOperator lessonOperate){
		this.lessonOperate = lessonOperate;
		createComponent();
		this.setBorder(false);
	}
	
	
	private void createComponent(){
		this.setLayout(new BorderLayout());
		
		//上
		LinkedBarPanel linkedBar = new LinkedBarPanel();
		
		this.add(linkedBar,new BorderLayoutData(RegionPosition.NORTH));
		
		//左
		Panel leftPanel = new Panel();
		leftPanel.setWidth(250);
		leftPanel.setBorder(false);
		leftPanel.setLayout(new VerticalLayout(10));
		
		SiteIDPanel siteID = new SiteIDPanel();
		
		siteID.setWidth(250);
		siteID.setHeight(80);
		siteID.setBorder(false);

		leftPanel.add(siteID);
				
		this.add(leftPanel,new BorderLayoutData(RegionPosition.WEST));
		
		searchPanel = new SearchPanel(lessonOperate);
		searchPanel.setBorder(false);
		this.add(searchPanel,new BorderLayoutData(RegionPosition.CENTER));
		
		Panel rightPanel = new Panel();
		rightPanel.setPaddings(30, 10, 0,0);
		rightPanel.setWidth(200);
		rightPanel.setBorder(false);

		LinkPanel linkPanel = new LinkPanel(lessonOperate);
		
		rightPanel.add(linkPanel);
		this.add(rightPanel,new BorderLayoutData(RegionPosition.EAST));
	}
}
